import dataBox from "./userPassword"
export default {
  // 模拟用户登录
  login: (config:any) => {
    let data = JSON.parse(config.body);
    let userList = {};
    var bel = dataBox.data.data.map(res => {
      if (data.username === res.username && data.password === res.password) {
        userList = res.userList
        return true
      } else {
        return false
      }
    })
    if (bel.includes(true)) {
      
    } else {
      return {
        code: -1,
        data: {
          msg: "用户名或密码错误",
          status: 'fail'
        }
      }
    }
    return {
      code: 200,
      data: {
        userList: userList
      }
    }
  },



}
